package com.tiancheng.trade.payment.enums;

import com.tiancheng.trade.commom.core.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * @Author: likailun
 * @Description: 银联请求类型枚举
 * @Date: create in 2025/03/17 3:20 下午
 */
@Getter
@AllArgsConstructor
public enum WithdrawalStatusEnum implements BaseEnum<String> {

    ING("ING","提现中"),
    SUCCESS("SUCCESS","提现成功"),
    FAIL("FAIL","提现失败"),
    ;
    private String code;
    private String desc;



    public static WithdrawalStatusEnum getByCode(String code){
        Optional<WithdrawalStatusEnum> found = Arrays.stream(WithdrawalStatusEnum.values()).filter(c -> c.code.equals(code)).findFirst();
        return found.orElse(null);
    }
}
